# -*- coding: UTF-8 -*-

##########################################################################
#
#   Copyright (c) 2020  Bresee, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###########################################################################

##  Get layer special effect parameters  获取图层特殊效果参数

import json
import os 
import utils.common.initres as initres

Effects_RUN = 1
class LayerEffects:
    
    path = initres.ELEMENTPATH+'/LayerEffects'
    #path = '/var/vlog/element/LayerEffects'
    effects = []
    effects_ = {}
 
    @classmethod    
    def effects_info(cls):
        if Effects_RUN == 0:
            cls.effects=[]
            cls.effects_={}
            tmp = os.listdir(cls.path)  # 获取目录下文件列表
            for i,effect_name in enumerate(tmp) :
                obj = {}  
                obj['id'] = i
                obj['name'] = effect_name
                if initres.YUN_WORKMODE == False :  # "http://" + socket.gethostbyname(hostname) + ":33033/elements/"
                    obj['thumbnail'] = initres.localElement + 'LayerEffects/' + effect_name + '/' + effect_name + '_display.jpg'
                    obj['displayVideo'] = initres.localElement + 'LayerEffects/' + effect_name + '/' + effect_name + '_display.mp4' 
                else :  # "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/"
                    obj['thumbnail'] = initres.element_path + 'LayerEffects/' + effect_name + '/' + effect_name + '_display.jpg'
                    obj['displayVideo'] = initres.element_path + 'LayerEffects/' + effect_name + '/' + effect_name + '_display.mp4'
                cls.effects.append(obj)
                
            for i,effect_name in enumerate(tmp) :
                cls.effects_[effect_name] = cls.path + effect_name
        else :
            cls.effects =[
                            {
                                "id": 0, 
                                "name": "VHS_Distortion", 
                                "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/VHS_Distortion/VHS_Distortion_display.jpg", 
                                "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/VHS_Distortion/VHS_Distortion_display.mp4"
                            }, 
                            # {
                            #     "id": 1,
                            #     "name": "Bokeh_Border_7",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_7/Bokeh_Border_7_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_7/Bokeh_Border_7_display.mp4"
                            # },
                            # {
                            #     "id": 2,
                            #     "name": "Bokeh_4",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_4/Bokeh_4_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_4/Bokeh_4_display.mp4"
                            # },
                            # {
                            #     "id": 3,
                            #     "name": "Bokeh_7",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_7/Bokeh_7_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_7/Bokeh_7_display.mp4"
                            # },
                            # {
                            #     "id": 4,
                            #     "name": "Tech_Review_Overlay_Overlay_01",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_01/Tech_Review_Overlay_Overlay_01_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_01/Tech_Review_Overlay_Overlay_01_display.mp4"
                            # },
                            # {
                            #     "id": 5,
                            #     "name": "lightLeaks_8",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_8/lightLeaks_8_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_8/lightLeaks_8_display.mp4"
                            # },
                            # {
                            #     "id": 6,
                            #     "name": "Warm_Border",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Warm_Border/Warm_Border_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Warm_Border/Warm_Border_display.mp4"
                            # },
                            # {
                            #     "id": 7,
                            #     "name": "LensFlare_3",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_3/LensFlare_3_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_3/LensFlare_3_display.mp4"
                            # },
                            # {
                            #     "id": 8,
                            #     "name": "Simple_Viewfinder",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Simple_Viewfinder/Simple_Viewfinder_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Simple_Viewfinder/Simple_Viewfinder_display.mp4"
                            # },
                            # {
                            #     "id": 9,
                            #     "name": "Flood_Damaged_Film",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Flood_Damaged_Film/Flood_Damaged_Film_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Flood_Damaged_Film/Flood_Damaged_Film_display.mp4"
                            # },
                            # {
                            #     "id": 10,
                            #     "name": "Bokeh_6",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_6/Bokeh_6_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_6/Bokeh_6_display.mp4"
                            # },
                            # {
                            #     "id": 11,
                            #     "name": "Bokeh_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_2/Bokeh_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_2/Bokeh_2_display.mp4"
                            # },
                            # {
                            #     "id": 12,
                            #     "name": "VHS_Distortion_Bad",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/VHS_Distortion_Bad/VHS_Distortion_Bad_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/VHS_Distortion_Bad/VHS_Distortion_Bad_display.mp4"
                            # },
                            # {
                            #     "id": 13,
                            #     "name": "Disco_Border",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Disco_Border/Disco_Border_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Disco_Border/Disco_Border_display.mp4"
                            # },
                            # {
                            #     "id": 14,
                            #     "name": "LensFlare_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_1/LensFlare_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_1/LensFlare_1_display.mp4"
                            # },
                            # {
                            #     "id": 15,
                            #     "name": "Filmpocalypse",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Filmpocalypse/Filmpocalypse_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Filmpocalypse/Filmpocalypse_display.mp4"
                            # },
                            # {
                            #     "id": 16,
                            #     "name": "Bokeh_Border_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_1/Bokeh_Border_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_1/Bokeh_Border_1_display.mp4"
                            # },
                            # {
                            #     "id": 17,
                            #     "name": "lightLeaks_4",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_4/lightLeaks_4_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_4/lightLeaks_4_display.mp4"
                            # },
                            # {
                            #     "id": 18,
                            #     "name": "Luv_Border_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Luv_Border_1/Luv_Border_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Luv_Border_1/Luv_Border_1_display.mp4"
                            # },
                            # {
                            #     "id": 19,
                            #     "name": "Aqua_Border_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Aqua_Border_1/Aqua_Border_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Aqua_Border_1/Aqua_Border_1_display.mp4"
                            # },
                            # {
                            #     "id": 20,
                            #     "name": "Bokeh_10",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_10/Bokeh_10_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_10/Bokeh_10_display.mp4"
                            # },
                            # {
                            #     "id": 21,
                            #     "name": "VHS_Rewind",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/VHS_Rewind/VHS_Rewind_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/VHS_Rewind/VHS_Rewind_display.mp4"
                            # },
                            # {
                            #     "id": 22,
                            #     "name": "Light_Mud_Splatter",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Light_Mud_Splatter/Light_Mud_Splatter_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Light_Mud_Splatter/Light_Mud_Splatter_display.mp4"
                            # },
                            # {
                            #     "id": 23,
                            #     "name": "Bokeh_Border_6",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_6/Bokeh_Border_6_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_6/Bokeh_Border_6_display.mp4"
                            # },
                            # {
                            #     "id": 24,
                            #     "name": "CinematicFlares_7",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_7/CinematicFlares_7_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_7/CinematicFlares_7_display.mp4"
                            # },
                            # {
                            #     "id": 25,
                            #     "name": "Vintage_Viewfinder",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Vintage_Viewfinder/Vintage_Viewfinder_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Vintage_Viewfinder/Vintage_Viewfinder_display.mp4"
                            # },
                            # {
                            #     "id": 26,
                            #     "name": "LensFlare_5",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_5/LensFlare_5_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_5/LensFlare_5_display.mp4"
                            # },
                            # {
                            #     "id": 27,
                            #     "name": "CinematicFlares_5",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_5/CinematicFlares_5_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_5/CinematicFlares_5_display.mp4"
                            # },
                            # {
                            #     "id": 28,
                            #     "name": "lightLeaks_5",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_5/lightLeaks_5_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_5/lightLeaks_5_display.mp4"
                            # },
                            # {
                            #     "id": 29,
                            #     "name": "Bokeh_Border_3",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_3/Bokeh_Border_3_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_3/Bokeh_Border_3_display.mp4"
                            # },
                            # {
                            #     "id": 30,
                            #     "name": "Strong_Glitch",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Strong_Glitch/Strong_Glitch_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Strong_Glitch/Strong_Glitch_display.mp4"
                            # },
                            # {
                            #     "id": 31,
                            #     "name": "Star_Border_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Star_Border_2/Star_Border_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Star_Border_2/Star_Border_2_display.mp4"
                            # },
                            # {
                            #     "id": 32,
                            #     "name": "Static_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Static_2/Static_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Static_2/Static_2_display.mp4"
                            # },
                            # {
                            #     "id": 33,
                            #     "name": "lightLeaks_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_2/lightLeaks_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_2/lightLeaks_2_display.mp4"
                            # },
                            # {
                            #     "id": 34,
                            #     "name": "CinematicFlares_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_1/CinematicFlares_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_1/CinematicFlares_1_display.mp4"
                            # },
                            # {
                            #     "id": 35,
                            #     "name": "Bokeh_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_1/Bokeh_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_1/Bokeh_1_display.mp4"
                            # },
                            # {
                            #     "id": 36,
                            #     "name": "Sparkle_Border",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Sparkle_Border/Sparkle_Border_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Sparkle_Border/Sparkle_Border_display.mp4"
                            # },
                            # {
                            #     "id": 37,
                            #     "name": "Film_Border_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Film_Border_2/Film_Border_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Film_Border_2/Film_Border_2_display.mp4"
                            # },
                            # {
                            #     "id": 38,
                            #     "name": "Water_Damaged_Film",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Water_Damaged_Film/Water_Damaged_Film_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Water_Damaged_Film/Water_Damaged_Film_display.mp4"
                            # },
                            # {
                            #     "id": 39,
                            #     "name": "Bokeh_3",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_3/Bokeh_3_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_3/Bokeh_3_display.mp4"
                            # },
                            # {
                            #     "id": 40,
                            #     "name": "Pro_Viewfinder_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Pro_Viewfinder_2/Pro_Viewfinder_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Pro_Viewfinder_2/Pro_Viewfinder_2_display.mp4"
                            # },
                            # {
                            #     "id": 41,
                            #     "name": "Star_Border_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Star_Border_1/Star_Border_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Star_Border_1/Star_Border_1_display.mp4"
                            # },
                            # {
                            #     "id": 42,
                            #     "name": "Tech_Review_Overlay_Overlay_02",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_02/Tech_Review_Overlay_Overlay_02_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_02/Tech_Review_Overlay_Overlay_02_display.mp4"
                            # },
                            # {
                            #     "id": 43,
                            #     "name": "Film_Border_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Film_Border_1/Film_Border_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Film_Border_1/Film_Border_1_display.mp4"
                            # },
                            # {
                            #     "id": 44,
                            #     "name": "Bokeh_9",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_9/Bokeh_9_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_9/Bokeh_9_display.mp4"
                            # },
                            # {
                            #     "id": 45,
                            #     "name": "Bokeh_Border_5",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_5/Bokeh_Border_5_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_5/Bokeh_Border_5_display.mp4"
                            # },
                            # {
                            #     "id": 46,
                            #     "name": "LensFlare_4",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_4/LensFlare_4_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_4/LensFlare_4_display.mp4"
                            # },
                            # {
                            #     "id": 47,
                            #     "name": "Bokeh_Border_4",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_4/Bokeh_Border_4_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_4/Bokeh_Border_4_display.mp4"
                            # },
                            # {
                            #     "id": 48,
                            #     "name": "CinematicFlares_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_2/CinematicFlares_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_2/CinematicFlares_2_display.mp4"
                            # },
                            # {
                            #     "id": 49,
                            #     "name": "Cool_Border",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Cool_Border/Cool_Border_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Cool_Border/Cool_Border_display.mp4"
                            # },
                            # {
                            #     "id": 50,
                            #     "name": "Bokeh_5",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_5/Bokeh_5_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_5/Bokeh_5_display.mp4"
                            # },
                            # {
                            #     "id": 51,
                            #     "name": "CinematicFlares_3",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_3/CinematicFlares_3_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_3/CinematicFlares_3_display.mp4"
                            # },
                            # {
                            #     "id": 52,
                            #     "name": "Static",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Static/Static_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Static/Static_display.mp4"
                            # },
                            # {
                            #     "id": 53,
                            #     "name": "Aqua_Border_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Aqua_Border_2/Aqua_Border_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Aqua_Border_2/Aqua_Border_2_display.mp4"
                            # },
                            # {
                            #     "id": 54,
                            #     "name": "Stud_Border",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Stud_Border/Stud_Border_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Stud_Border/Stud_Border_display.mp4"
                            # },
                            # {
                            #     "id": 55,
                            #     "name": "lightLeaks_7",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_7/lightLeaks_7_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_7/lightLeaks_7_display.mp4"
                            # },
                            # {
                            #     "id": 56,
                            #     "name": "Shadow_Border",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Shadow_Border/Shadow_Border_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Shadow_Border/Shadow_Border_display.mp4"
                            # },
                            # {
                            #     "id": 57,
                            #     "name": "Tech_Review_Overlay_Overlay_07",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_07/Tech_Review_Overlay_Overlay_07_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_07/Tech_Review_Overlay_Overlay_07_display.mp4"
                            # },
                            # {
                            #     "id": 58,
                            #     "name": "LensFlare_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_2/LensFlare_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/LensFlare_2/LensFlare_2_display.mp4"
                            # },
                            # {
                            #     "id": 59,
                            #     "name": "Tech_Review_Overlay_Overlay_03",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_03/Tech_Review_Overlay_Overlay_03_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Tech_Review_Overlay_Overlay_03/Tech_Review_Overlay_Overlay_03_display.mp4"
                            # },
                            # {
                            #     "id": 60,
                            #     "name": "lightLeaks_1",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_1/lightLeaks_1_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_1/lightLeaks_1_display.mp4"
                            # },
                            # {
                            #     "id": 61,
                            #     "name": "lightLeaks_3",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_3/lightLeaks_3_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_3/lightLeaks_3_display.mp4"
                            # },
                            # {
                            #     "id": 62,
                            #     "name": "Bokeh_Border_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_2/Bokeh_Border_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_Border_2/Bokeh_Border_2_display.mp4"
                            # },
                            # {
                            #     "id": 63,
                            #     "name": "Luv_Border_2",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Luv_Border_2/Luv_Border_2_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Luv_Border_2/Luv_Border_2_display.mp4"
                            # },
                            # {
                            #     "id": 64,
                            #     "name": "Leader",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Leader/Leader_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Leader/Leader_display.mp4"
                            # },
                            # {
                            #     "id": 65,
                            #     "name": "CinematicFlares_6",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_6/CinematicFlares_6_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_6/CinematicFlares_6_display.mp4"
                            # },
                            # {
                            #     "id": 66,
                            #     "name": "Bokeh_8",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_8/Bokeh_8_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Bokeh_8/Bokeh_8_display.mp4"
                            # },
                            # {
                            #     "id": 67,
                            #     "name": "lightLeaks_6",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_6/lightLeaks_6_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/lightLeaks_6/lightLeaks_6_display.mp4"
                            # },
                            # {
                            #     "id": 68,
                            #     "name": "Film_Border_3",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Film_Border_3/Film_Border_3_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/Film_Border_3/Film_Border_3_display.mp4"
                            # },
                            # {
                            #     "id": 69,
                            #     "name": "CinematicFlares_4",
                            #     "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_4/CinematicFlares_4_display.jpg",
                            #     "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/LayerEffects/CinematicFlares_4/CinematicFlares_4_display.mp4"
                            # }
                        ]

            cls.effects_ = {
                                "VHS_Distortion": "/var/vlog/element/LayerEffectsVHS_Distortion", 
                                "Bokeh_Border_7": "/var/vlog/element/LayerEffectsBokeh_Border_7", 
                                "Bokeh_4": "/var/vlog/element/LayerEffectsBokeh_4", 
                                "Bokeh_7": "/var/vlog/element/LayerEffectsBokeh_7", 
                                "Tech_Review_Overlay_Overlay_01": "/var/vlog/element/LayerEffectsTech_Review_Overlay_Overlay_01", 
                                "lightLeaks_8": "/var/vlog/element/LayerEffectslightLeaks_8", 
                                "Warm_Border": "/var/vlog/element/LayerEffectsWarm_Border", 
                                "LensFlare_3": "/var/vlog/element/LayerEffectsLensFlare_3", 
                                "Simple_Viewfinder": "/var/vlog/element/LayerEffectsSimple_Viewfinder", 
                                "Flood_Damaged_Film": "/var/vlog/element/LayerEffectsFlood_Damaged_Film", 
                                "Bokeh_6": "/var/vlog/element/LayerEffectsBokeh_6", 
                                "Bokeh_2": "/var/vlog/element/LayerEffectsBokeh_2", 
                                "VHS_Distortion_Bad": "/var/vlog/element/LayerEffectsVHS_Distortion_Bad", 
                                "Disco_Border": "/var/vlog/element/LayerEffectsDisco_Border", 
                                "LensFlare_1": "/var/vlog/element/LayerEffectsLensFlare_1", 
                                "Filmpocalypse": "/var/vlog/element/LayerEffectsFilmpocalypse", 
                                "Bokeh_Border_1": "/var/vlog/element/LayerEffectsBokeh_Border_1", 
                                "lightLeaks_4": "/var/vlog/element/LayerEffectslightLeaks_4", 
                                "Luv_Border_1": "/var/vlog/element/LayerEffectsLuv_Border_1", 
                                "Aqua_Border_1": "/var/vlog/element/LayerEffectsAqua_Border_1", 
                                "Bokeh_10": "/var/vlog/element/LayerEffectsBokeh_10", 
                                "VHS_Rewind": "/var/vlog/element/LayerEffectsVHS_Rewind", 
                                "Light_Mud_Splatter": "/var/vlog/element/LayerEffectsLight_Mud_Splatter", 
                                "Bokeh_Border_6": "/var/vlog/element/LayerEffectsBokeh_Border_6", 
                                "CinematicFlares_7": "/var/vlog/element/LayerEffectsCinematicFlares_7", 
                                "Vintage_Viewfinder": "/var/vlog/element/LayerEffectsVintage_Viewfinder", 
                                "LensFlare_5": "/var/vlog/element/LayerEffectsLensFlare_5", 
                                "CinematicFlares_5": "/var/vlog/element/LayerEffectsCinematicFlares_5", 
                                "lightLeaks_5": "/var/vlog/element/LayerEffectslightLeaks_5", 
                                "Bokeh_Border_3": "/var/vlog/element/LayerEffectsBokeh_Border_3", 
                                "Strong_Glitch": "/var/vlog/element/LayerEffectsStrong_Glitch", 
                                "Star_Border_2": "/var/vlog/element/LayerEffectsStar_Border_2", 
                                "Static_2": "/var/vlog/element/LayerEffectsStatic_2", 
                                "lightLeaks_2": "/var/vlog/element/LayerEffectslightLeaks_2", 
                                "CinematicFlares_1": "/var/vlog/element/LayerEffectsCinematicFlares_1", 
                                "Bokeh_1": "/var/vlog/element/LayerEffectsBokeh_1", 
                                "Sparkle_Border": "/var/vlog/element/LayerEffectsSparkle_Border", 
                                "Film_Border_2": "/var/vlog/element/LayerEffectsFilm_Border_2", 
                                "Water_Damaged_Film": "/var/vlog/element/LayerEffectsWater_Damaged_Film", 
                                "Bokeh_3": "/var/vlog/element/LayerEffectsBokeh_3", 
                                "Pro_Viewfinder_2": "/var/vlog/element/LayerEffectsPro_Viewfinder_2", 
                                "Star_Border_1": "/var/vlog/element/LayerEffectsStar_Border_1", 
                                "Tech_Review_Overlay_Overlay_02": "/var/vlog/element/LayerEffectsTech_Review_Overlay_Overlay_02", 
                                "Film_Border_1": "/var/vlog/element/LayerEffectsFilm_Border_1", 
                                "Bokeh_9": "/var/vlog/element/LayerEffectsBokeh_9", 
                                "Bokeh_Border_5": "/var/vlog/element/LayerEffectsBokeh_Border_5", 
                                "LensFlare_4": "/var/vlog/element/LayerEffectsLensFlare_4", 
                                "Bokeh_Border_4": "/var/vlog/element/LayerEffectsBokeh_Border_4", 
                                "CinematicFlares_2": "/var/vlog/element/LayerEffectsCinematicFlares_2", 
                                "Cool_Border": "/var/vlog/element/LayerEffectsCool_Border", 
                                "Bokeh_5": "/var/vlog/element/LayerEffectsBokeh_5", 
                                "CinematicFlares_3": "/var/vlog/element/LayerEffectsCinematicFlares_3", 
                                "Static": "/var/vlog/element/LayerEffectsStatic", 
                                "Aqua_Border_2": "/var/vlog/element/LayerEffectsAqua_Border_2", 
                                "Stud_Border": "/var/vlog/element/LayerEffectsStud_Border", 
                                "lightLeaks_7": "/var/vlog/element/LayerEffectslightLeaks_7", 
                                "Shadow_Border": "/var/vlog/element/LayerEffectsShadow_Border", 
                                "Tech_Review_Overlay_Overlay_07": "/var/vlog/element/LayerEffectsTech_Review_Overlay_Overlay_07", 
                                "LensFlare_2": "/var/vlog/element/LayerEffectsLensFlare_2", 
                                "Tech_Review_Overlay_Overlay_03": "/var/vlog/element/LayerEffectsTech_Review_Overlay_Overlay_03", 
                                "lightLeaks_1": "/var/vlog/element/LayerEffectslightLeaks_1", 
                                "lightLeaks_3": "/var/vlog/element/LayerEffectslightLeaks_3", 
                                "Bokeh_Border_2": "/var/vlog/element/LayerEffectsBokeh_Border_2", 
                                "Luv_Border_2": "/var/vlog/element/LayerEffectsLuv_Border_2", 
                                "Leader": "/var/vlog/element/LayerEffectsLeader", 
                                "CinematicFlares_6": "/var/vlog/element/LayerEffectsCinematicFlares_6", 
                                "Bokeh_8": "/var/vlog/element/LayerEffectsBokeh_8", 
                                "lightLeaks_6": "/var/vlog/element/LayerEffectslightLeaks_6", 
                                "Film_Border_3": "/var/vlog/element/LayerEffectsFilm_Border_3", 
                                "CinematicFlares_4": "/var/vlog/element/LayerEffectsCinematicFlares_4"
                            }
            
        print('effects: {}'.format(json.dumps(cls.effects)))
        print('effects_: {}'.format(json.dumps(cls.effects_)))
    
    @classmethod    
    def get_effects(cls)-> list:
        return cls.effects
    
    @classmethod 
    def get_effects_(cls):
        return cls.effects_
    
    
class VideoSpecialEffects:
    
    path = initres.ELEMENTPATH+'/VideoSpecialEffects'
    #path = '/var/vlog/element/videoSpecialEffects'
    effects = []
    effects_ = {}
 
    @classmethod    
    def effects_info(cls):
        if Effects_RUN == 0:
            cls.effects=[]
            cls.effects_={}
            tmp = os.listdir(cls.path)
            for i,effect_name in enumerate(tmp) :
                obj = {} 
                obj['id']        = i
                obj['name'] = effect_name
                if initres.YUN_WORKMODE == False :
                    obj['thumbnail'] = initres.localElement + 'VideoSpecialEffects/' + effect_name + '/' + effect_name + '_display.jpg'
                    obj['displayVideo'] = initres.localElement + 'VideoSpecialEffects/' + effect_name + '/' + effect_name + '_display.mp4'
                else :
                    obj['thumbnail'] = initres.element_path + 'VideoSpecialEffects/' + effect_name + '/' + effect_name + '_display.jpg'
                    obj['displayVideo'] = initres.element_path + 'VideoSpecialEffects/' + effect_name + '/' + effect_name + '_display.mp4'
                    
                cls.effects.append(obj)
                
            for i,effect_name in enumerate(tmp) :
                cls.effects_[effect_name] = cls.path + effect_name
        else :
            cls.effects = [
                            {
                                "id": 0, 
                                "name": "pushPull",  # 摇移
                                "ch_name": "摇移",  # 摇移
                                "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/VideoSpecialEffects/ObjShake/ObjShake_display.jpg",
                                "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/VideoSpecialEffects/ObjShake/ObjShake_display.mp4"
                            }, 
                            {
                                "id": 1, 
                                "name": "snapShot",  # 定格
                                "ch_name": "定格",
                                "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/VideoSpecialEffects/FreezeFrame/FreezeFrame_display.jpg", 
                                "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/VideoSpecialEffects/FreezeFrame/FreezeFrame_display.mp4"
                            }, 
                            {
                                "id": 2, 
                                "name": "videoRate",  # 倍速
                                "ch_name": "倍速",  # 倍速
                                "thumbnail": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/VideoSpecialEffects/SlowMotion/SlowMotion_display.jpg",
                                "displayVideo": "https://front-vlog-1311402863.cos.ap-nanjing.myqcloud.com/var/vlog/element/VideoSpecialEffects/SlowMotion/SlowMotion_display.mp4"
                            }
                        ]

            cls.effects_ =  {
                                "ObjShake": "/var/vlog/element/VideoSpecialEffectsObjShake", 
                                "FreezeFrame": "/var/vlog/element/VideoSpecialEffectsFreezeFrame", 
                                "SlowMotion": "/var/vlog/element/VideoSpecialEffectsSlowMotion"
                            }

            
        print('effects: {}'.format(json.dumps(cls.effects)))
        print('effects_: {}'.format(json.dumps(cls.effects_)))
    
    @classmethod    
    def get_effects(cls)-> list:
        return cls.effects
    
    @classmethod 
    def get_effects_(cls):
        return cls.effects_
            
            
    
            
            
  
            
if __name__ == '__main__':

    LayerEffects.effects_info()
    print('effects: {}'.format(LayerEffects.effects))
    print('effects_: {}'.format(LayerEffects.effects_)) 
    

    print('effects: {}'.format(LayerEffects.get_effects()))
    print('effects_: {}'.format(LayerEffects.get_effects_())) 
 